package com.yijiaganxi.services.api.article;

import javax.validation.constraints.NotBlank;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.yijiaganxi.common.entity.article.YjgxArticle;
import org.yijiaganxi.common.res.R;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import org.yijiaganxi.common.GlobalConstants;
import com.yijiaganxi.services.service.article.YjgxArticleService;

@Validated
@RestController
@RequestMapping("/services/yjgxArticle/"+GlobalConstants.WECHAT_FLAG)
public class YjgxArticleApi {

	@Autowired
	private YjgxArticleService articleService;
	
	/**
	 * 查询首页轮播链接地址
	 * @return
	 */
	@GetMapping("getArticleByIdApi")
	private R getArticleByIdApi(@NotBlank(message = "linkUrl必填") String linkUrl) {
		return R.opertionListResponse( articleService.selectList(new EntityWrapper<YjgxArticle>()
				.eq("id", linkUrl)
				.setSqlSelect("title","createDate","context")));
	}
	
}
